package com.cl.short_video_java.menum;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author 付
 * @Date 2024-12-03 10:21
 * @Version 1.0
 * @description
 * @since 1.0
 */
@Slf4j
public enum VideoSort {
	SORT(1, "sort"),
	LOOK_COUNT(2, "look_count"),
	CREATE_TIME(3, "create_time"),
	COLLECTION(4, "collection"),
	THUMB_UP(5, "thump_up");

	private Integer code;
	private String value;

	VideoSort(Integer code, String value) {
		this.code = code;
		this.value = value;
	}

	public Integer getKey() {
		return code;
	}

	public String getValue() {
		return value;
	}

	public static String getValueByKey(Integer index) {
		for (VideoSort videoSort : VideoSort.values()) {
			if (videoSort.getKey().equals(index)) {
				return videoSort.getValue();
			}
		}
		return null;
	}
}
